{php include wl_template('common/header');}
<style type='text/css'>
	.trbody td {text-align: center; vertical-align:top;border-left:1px solid #ccc; border-bottom: 1px solid #ddd;}
	.order-rank img{width:16px; height:16px;}
	.js-admin-remark{word-break:break-all; overflow:hidden; background: #FDEEEE;color: #ED5050;padding: 5px 10px;}
	.goods-info{position:relative; padding-left:60px;}
	.goods-info .img{position:absolute;top:50%; margin-top:-25px; background: url({IMAGE_LOADING}) center center no-repeat; width:50px;height:50px; }
	.goods-info span {white-space: inherit;overflow: hidden;text-overflow: ellipsis;display: block;}
	.table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {border-top: 1px solid rgba(221, 221, 221, 0);}
</style>
<ul class="nav nav-tabs" id="myTab">
	<li class="active"><a href="#">订单列表</a></li>
</ul>
<div class="app-content">
	<div class="app-filter">
		<div class="filter-list">
			<form action="" method="get" class="form-horizontal" role="form" id="form1">
				<input type="hidden" name="c" value="site" />
				<input type="hidden" name="a" value="entry" />
				<input type="hidden" name="m" value="{MODULE_NAME}" />
				<input type="hidden" name="p" value="pocket" />
				<input type="hidden" name="ac" value="Tiezi" />
				<input type="hidden" name="do" value="orders" />
				<input type="hidden" name="fightstatus" value="{$fightstatus}" />
				<div class="form-group">
					<label class="col-sm-2 control-label">销售类型</label>
					<div class="col-sm-9">
						<div class="btn-group">
							<a href="{php echo wl_filter_url('fightstatus:0');}" class="btn {if $fightstatus == 0 || empty($fightstatus) }btn-primary{else}btn-default{/if}">全部</a>
							<a href="{php echo wl_filter_url('fightstatus:1');}" class="btn {if $fightstatus == 1}btn-primary{else}btn-default{/if}">发帖</a>
							<a href="{php echo wl_filter_url('fightstatus:2');}" class="btn {if $fightstatus == 2}btn-primary{else}btn-default{/if}">置顶</a>
							<a href="{php echo wl_filter_url('fightstatus:3');}" class="btn {if $fightstatus == 3}btn-primary{else}btn-default{/if}">红包</a>
							<a href="{php echo wl_filter_url('fightstatus:4');}" class="btn {if $fightstatus == 4}btn-primary{else}btn-default{/if}">刷新</a>
							{if Customized::init('pocket1500') > 0}
							<a href="{php echo wl_filter_url('fightstatus:5');}" class="btn {if $fightstatus == 5}btn-primary{else}btn-default{/if}">视频</a>
							{/if}
							{if Customized::init('pocket140') > 0}
							<a href="{php echo wl_filter_url('fightstatus:6');}" class="btn {if $fightstatus == 6}btn-primary{else}btn-default{/if}">推广</a>
							{/if}
							{if Customized::init('transfer1510') > 0}
							<a href="{php echo wl_filter_url('fightstatus:7');}" class="btn {if $fightstatus == 7}btn-primary{else}btn-default{/if}">转让</a>
							{/if}
							<a href="{php echo wl_filter_url('fightstatus:8');}" class="btn {if $fightstatus == 8}btn-primary{else}btn-default{/if}">打赏</a>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">搜索</label>
					<div class="col-sm-2">
						<select name="keywordtype" class="form-control">
							<option value="">关键字类型</option>
							<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>订单ID</option>
							<option value="2" {if $_GPC['keywordtype']==2}selected="selected"{/if}>订单编号</option>
							<option value="3" {if $_GPC['keywordtype']==3}selected="selected"{/if}>帖子内容</option>
							<option value="5" {if $_GPC['keywordtype']==5}selected="selected"{/if}>用户昵称</option>
							<option value="6" {if $_GPC['keywordtype']==6}selected="selected"{/if}>用户电话</option>
						</select>
					</div>
					<div class="col-sm-4">
						<div class="input-group">
							<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}"  placeholder="请输入关键字"/>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">下单时间</label>
					<div class="col-sm-9">
						{php echo tpl_select_time_info('time_limit', array('starttime' => date('Y-m-d',$starttime), 'endtime' => date('Y-m-d', $endtime)));}
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"></label>
					<div class="col-sm-9">
						<button class="btn btn-primary min-width" type="submit">筛选</button>
					</div>
				</div>
			</form>
		</div>
	</div>
	<div class="app-table-list">
		<div class="order-list">
			<div class="panel-body table-responsive collapse in" id="order-template-item-4" style="padding: 0;">
				<table class="table table-bordered">
					<thead style="background-color: #FFFFFF;">
					<tr>
						<th style="width:50px;text-align:center;">序号</th>
						<th style="width:180px;text-align:center;">帖子内容</th>
						<th style="width:120px; text-align:center;">帖子分类</th>
						<th style="width:160px; text-align:center;">置顶时间(开始/结束)</th>
						<th style="width:180px; text-align:center;">支付人</th>
						<th style="width:80px; text-align:center;">支付信息</th>
						<th style="width:130px; text-align:center;">时长/金额</th>
					</tr>
					</thead>
				</table>
			</div>
			{loop $list $y $item}
			<div class="panel panel-default">
				<div class="panel-heading clearfix" style="border: 1px solid #e5e5e5;">
					<div class="pull-left">
						<span>订单号：{$item['orderno']}</span>
						<!--<span>||&nbsp;下单时间: {php echo date('Y-m-d', $item['createtime'])} {php echo date('H:i:s', $item['createtime'])} </span>-->
						<span>||&nbsp;支付时间: {php echo date('Y-m-d', $item['paytime'])} {php echo date('H:i:s', $item['paytime'])}&nbsp;</span>
					</div>
					<div class="pull-right">
						<span class="text-muted"></span>&nbsp;&nbsp;
						<a href="{php echo web_url('pocket/Tiezi/details',array('id'=>$item['fkid']))}" >查看帖子</a>
					</div>
				</div>
				<div class="panel-body table-responsive" style="padding: 0px;">
					<table class="table table-bordered">
						<tbody >
						<tr>
							<td style="width: 50px;" ><center>{php echo $y+1}</center></td>
							<td class="goods-info line-feed" style="width:180px;">
								<div class="title">
									<span>{$item['content']}</span>
								</div>
							</td>
							<td class="text-center" style="width:120px;">
								<div class="img"><img class="scrollLoading" src="{IMAGE_PIXEL}" data-url="{php echo tomedia($item['logo'])}" height="50" width="50" onerror="this.src='{IMAGE_NOPIC_SMALL}'" ></div>
								<div class="title">
									<span>{$item['type']}</span>
								</div>
							</td>
							<td class="text-center" style="width:160px;">
								{if $item['endtime']}
								<p>{php echo date('Y-m-d H:i:s',$item['paytime'])}</p>
								<p>{php echo date('Y-m-d H:i:s',$item['endtime'])}</p>
								{else}
								<span class="label label-warning">未置顶</span>
								{/if}
							</td>
							<td class="goods-info line-feed" style="width:180px;padding-left: 10px;">
								<div style="position: relative;top: 30px;left: 5px;" class="img"><img style="height: 100%;width: 100%;" class="scrollLoading" src="{IMAGE_PIXEL}" data-url="{php echo tomedia($item['avatar'])}"></div>
								<div class="title" style="padding-left: 60px;position: relative;top: -15px;">
									<span>{$item['nickname']}</span>
									<span>{$item['phone']}</span>
								</div>
							</td>
							<td class="text-center" style="width:80px;">
								{if $item['fightstatus']=='1'}<span class="label label-success">发帖</span><br><br>{/if}
								{if $item['fightstatus']=='2'}<span class="label label-info">置顶</span><br><br>{/if}
								{if $item['fightstatus']=='3'}<span class="label label-danger">红包</span><br><br>{/if}
								{if $item['fightstatus']=='4'}<span class="label label-default">刷新</span><br><br>{/if}
								{if $item['fightstatus']=='5'}<span class="label label-primary">视频</span><br><br>{/if}
								{if $item['fightstatus']=='6'}<span class="label label-primary">推广</span><br><br>{/if}
								{if $item['fightstatus']=='7'}<span class="label label-primary">转让</span><br><br>{/if}
								{if $item['fightstatus']=='8'}<span class="label label-success">打赏</span><br><br>{/if}
								{if $item['paytype']==1}<span class="label label-info">余额支付</span>{/if}
								{if $item['paytype']==2}<span class="label label-success">微信支付</span>{/if}
								{if $item['paytype']==3}<span class="label label-warning">支付宝</span>{/if}
								{if $item['paytype']==4}<span class="label label-danger">货到付款</span>{/if}
							</td>
							<td class="text-center" style="width:130px;">
								{if $item['fightstatus'] == 2}
									置顶时长：{$item['num']}天<br />
								{/if}
								实付：￥{if empty($item['price'])}0.00{else}{$item['price']}{/if}<br>
							</td>
						</tr>
						</tbody>
					</table>
				</div>
				<div class="panel-footer js-admin-remark{$item['id']} js-admin-remark" order-id="{$item['id']}" {if empty($item['remark'])}style="display: none;"{/if} style="background-color:lightgoldenrodyellow">
				卖家备注：<span id="js-admin-remark{$item['id']}" style="">{$item['remark']}</span>
				</div>
			</div>
			{/loop}
		</div>
		<div class="app-table-foot clearfix">
			<div class="pull-left">
			</div>
			<div class="pull-right">
				{$pager}
			</div>
		</div>
	</div>
	<div id="modal-module-gift" class="modal fade" tabindex="-1">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
					<h3>我的备注</h3>
				</div>
				<div class="modal-body">
					<div class="modal-body">
						<textarea id="remark" name="admin_remark" class="form-control" rows="5" placeholder="请输入备注内容"></textarea>
					</div>
				</div>
				<div class="modal-footer">
					<a class="btn btn-default js-cancel" aria-hidden="true" data-dismiss="modal">取消</a>
					<a class="btn btn-primary js-order-remark-post" order-id="" data-dismiss="modal" aria-hidden="true">确定</a>
				</div>
			</div>
		</div>
	</div>
</div>
<script>
	// 修改备注
	$('.js-order-edit-remark').click(function(){
		var order_id = $(this).attr('order-id');
		var remarkvalue = $('#js-admin-remark'+order_id).text();
		$('.js-order-remark-post').attr("order-id",order_id);
		$('#remark').val(remarkvalue);
		popwin = $('#modal-module-gift').modal();
	});
	$('.js-cancel,.close').click(function() {
		$('#order-remark-container').hide();
		$('.main').css("opacity","1");$('.nav').css("opacity","1");$('.big-menu').css("opacity","1");
	});
	$('.js-order-remark-post').click(function() {
		var order_id = $(this).attr('order-id');
		var remark = $('#remark').val();
		$.post("{php echo web_url('wlfightgroup/fightorder/remark')}",{id:order_id,remark:remark},function(d){
			if(!d.errno){
				$('#js-admin-remark'+order_id).html(remark);
				$('.js-admin-remark'+order_id).show();
			}
		},"json");
		$('#order-remark-container').hide();
		$('.main').css("opacity","1");$('.nav').css("opacity","1");$('.big-menu').css("opacity","1");
	});
</script>
{php include wl_template('common/footer');}
